import { Spin } from 'antd'
import React,{ Suspense } from 'react'

// 高阶组件实现路由组件懒加载
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const lazyLoad = (Comp:React.LazyExoticComponent<any>):React.ReactNode=>{
  return (
    <Suspense fallback={<Spin
      size='large'
      style={{
        display:'flex',
        justifyContent:'center',
        alignItems:'center',
        height:'100vh'
      }}
    ></Spin>}>

      <Comp/>
    </Suspense>
  )
}


export default lazyLoad